<template>
  <div>
    <template v-for="item in this.menuList">
      <!--视频采集-->
      <el-submenu :disabled="item.disabled" :index="item.id+''" :key="item.id+''" v-if="item.children.length>0" >
        <template slot="title">
          <i :class="item.icon"></i>
          <span slot="title">{{item.menuName}}</span>
        </template>
        <!--        <el-menu-item index="1-1">-->
        <!--          <i class="el-icon-location"></i>-->
        <!--          <span slot="title">开始采集</span>-->
        <!--        </el-menu-item>-->
        <!--        <el-menu-item index="1-2">-->
        <!--          <i class="el-icon-location"></i>-->
        <!--          <span slot="title">采集历史</span>-->
        <!--        </el-menu-item>-->
        <MenuTree :menuList="item.children"></MenuTree>
      </el-submenu>
      <el-menu-item
          v-else
          :disabled="item.disable"
          :index="item.parentId+'-'+item.id"
          :route="item.url+''"
          @click="savePath(item.url)"
          :key="item.id">
        <i :class="item.icon"></i>
        <span>{{item.menuName}}</span>
      </el-menu-item>
    </template>
  </div>
</template>

<script>
export default {
  name: 'MenuTree',
  data() {
    return {

    };
  },
  beforeMount() {},
  props: ["menuList"],
  methods:{
    //保存激活路径
    savePath(path) {
      window.sessionStorage.setItem("activePath", path);
      this.activePath = path;
    },
  },
  created(){

  }
};
</script>

<style scoped>

</style>
